/**
 * @(#)UrlUtils.java, 2010-5-15. 
 * 
 */
package com.rsstuan.utils;

/**
 *
 * @author guosq
 *
 */
public class UrlUtils {
    
    public static String getUrlDomain(String url) {
        String head = "http://";
        String link = url;
        if (!link.startsWith(head)) {
            link = head + link;
        }
        int hi = head.length() + 1;
        int index = link.indexOf("/", hi);
        if (index < 0)
            return link;
        return link.substring(0, index);
    }

}
